#include "gtest/gtest.h"

#include "linkedlist.h"

using namespace algo;

// add test
TEST(AddTest, HandlesAdd)
{
	LinkedList<int> list;
	list.add(1);
	list.add(0, 0);
	list.append(2);
	list.append(3);
	std::shared_ptr<int> p1 = list.getFirst();
	std::shared_ptr<int> p2 = list.getLast();
	bool flag = (*p1 == 0) && (*p2 == 3) && (list.size() == 4);
    EXPECT_EQ(flag, true);
}

int main(int argc, char **argv)
{
	::testing::InitGoogleTest(&argc, argv);
	return RUN_ALL_TESTS();
}